package NG::Sys::Spec::BlockerInterface;
use strict;
use warnings;


sub attach {
	my $parent = shift;
	my $child = shift;
	
	my $locker = shift;
	my $namespace = shift;

	for(qw(has get free try weak)){
		no strict 'refs';
		*{$parent."::lock_".$_} = eval "sub {
				return \$locker->$_('$namespace'.\$_[1]);
			}";
		*{$child."::lock_".$_} = eval "sub {
				return \$locker->$_('$namespace'.\$_[0]{id});
			}";
	}
}

1;
